package com.tb.common;

import org.im4java.core.*;
import org.junit.Test;

import java.io.IOException;

/**
 * comment
 *
 * @author zhao yuan
 * @since 2018/6/27
 */
public class ImagickTest {

    @Test
    public void quickStart() throws InterruptedException, IOException, IM4JavaException {
        IMOperation im = new IMOperation();
        im.addImage("D:\\img\\*.jpg");
        im.addImage("d:\\img\\tmpImg2.png");
        MontageCmd montage = new MontageCmd();
        montage.run(im, new Object[0]);
//        DisplayCmd.show("d:\\img\\tmpImg.png");
    }

    @Test
    public void quickConvert() throws InterruptedException, IOException, IM4JavaException {
        System.err.println(" 1. Testing convert ...");
        String iTmpImage= "d:\\img\\tmpImg3.png";
        boolean var1 = false;

        IMOperation op = new IMOperation();
        op.addImage();
        if (!var1) {
            op.addImage();
        }
        op.bordercolor("darkgray");
        op.border(Integer.valueOf(10), Integer.valueOf(10));
        op.appendHorizontally();

        op.addImage(new String[]{iTmpImage});
//        String[] var3 = new String[]{iImageDir + "tulip1.jpg", iImageDir + "tulip 2.jpg"};
        ConvertCmd convert = new ConvertCmd();

//        convert.run();
        DisplayCmd.show(iTmpImage);
    }
}
